import { defineStore } from 'pinia';

export const useStore = defineStore('n2c', {
  state: () => ({
    baseUrl: localStorage.getItem('n2c_base') || 'http://localhost:8787',
    panels: [],
    global: { targetPanelCount: 3 },
    images: [],
    stylePreset: '日式漫画',
  }),
  actions: {
    setBase(url){ this.baseUrl = url; localStorage.setItem('n2c_base', url); },
    setPanels(p, g){ this.panels = p; if(g) this.global = g; },
    setImages(imgs){ this.images = imgs; }
  }
});
